import { createHashRouter, RouterProvider, redirect } from 'react-router-dom'
const routers = createHashRouter([
  {
    path: '',
    loader: () => {
      return redirect('/tools/npc')
    }
  },
  {
    path: 'tools',
    lazy: () => import('../pages/tools/Tools'),
    children: [
      {
        path: 'npc',
        lazy: () => import('../pages/tools/npc/NpcTool')
      }
    ]
  },
  {
    path: '*',
    loader: () => {
      return redirect('/tools/npc')
    }
  }
])

export const Routers = () => {
  return <RouterProvider router={routers} />
}
